package com.cyh.testdesignpattern.singleton;

/**
 * 饿汉式（静态代码块）
 * 优缺点：优缺点跟Singleton01一样
 * 结论：跟Singleton01一样
 * */
public class Singleton02 {
    private static Singleton02 instance;
    private void Singleton02(){
    }
    static {
        instance = new Singleton02();
    }
    public static Singleton02 getInstance() {
        return instance;
    }
}
